<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition>
    <p:panel id="pnlSmsSend" header="SMS enviado" widgetVar="panelSmsSend">

        <p:dataTable id="dataTableSmsSend" value="#{smsDashboardMBean.listSmsSend}" var="smsSend" paginator="true" rows="10" dynamic="true" paginatorPosition="top">
            <p:column>
                <f:facet name="header">Telefone</f:facet>
                <h:outputText value="#{smsSend.clientPhone.phone}"/>
            </p:column>

            <p:column>
                <f:facet name="header">Mensagem</f:facet>
                <h:outputText value="#{smsSend.message}"/>
            </p:column>

            <p:column width="90" rendered="#{logonMBean.login.loginRulesView.root}">
                <f:facet name="header">Registrado</f:facet>
                <h:outputLabel value="#{smsSend.datetimeRegistered}">
                    <f:convertDateTime dateStyle="short" type="date" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM kk:mm:ss"/>
                </h:outputLabel>
            </p:column>

            <p:column width="90">
                <f:facet name="header">Enviado</f:facet>
                <h:outputLabel value="#{smsSend.datetimeSent}">
                    <f:convertDateTime dateStyle="short" type="date" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM kk:mm:ss"/>
                </h:outputLabel>
            </p:column>

            <p:column>
                <f:facet name="header">Situação</f:facet>
                <h:outputText value="#{smsSend.status}"/>
            </p:column>

            <p:column rendered="#{logonMBean.login.loginRulesView.root}">
                <f:facet name="header">Send</f:facet>
                <h:outputLabel value="#{smsSend.delivered}"/>
            </p:column>
        </p:dataTable>

        <p:commandButton id="btnSendSms" value="Enviar SMS" styleClass="btn" onclick="create_sms_send.show()"/>
        <p:commandButton id="btnImportSms" value="Importar" styleClass="btn" onclick="import_sms_send.show()"/>
    </p:panel>
</ui:composition>
</html>